@extends('common.base-master')

@section('html-head')
    <link href="{{url('css/bootstrap.min.css')}}" type="text/css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="{{url('css/institu_details.css')}}">
    <script src="{{url('js/institu_details.js')}}"></script>
@endsection

@section('html-body')
    <main>
        <div class="wrapp">
            <section class="headConten">
                <h1>机构详情</h1>
                <div class="user">
                    <dl>
                        <dt><a href="#"><img src="{{route('Api.OrgLogo.Show' , ['id'=>$org->id])}}" width="100"
                                             height="100"
                                        /></a></dt>
                        <dd class="info">
                            <p><a href="#"><strong>{{$org->invest_name}}</strong></a></p>
                            <p class="desc">{{$org->invest_desc}}</p>
                        </dd>
                        <dd class="test">
                            <div class="share_wrap">
                                <a href="#" class="share">分享</a>
                                <a href="#" class="focus">关注</a>
                                <div class="iBtn bdsharebuttonbox">
                                    <ul>
                                        <li class="qq"><a href="#" style="float: none; background:none;padding-left:0;margin:0;width:100%;height:40px;" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间" ><em>分享到QQ</em></a></li>
                                        <li class="weibo"><a href="#" style="float: none; background:none;padding-left:0;margin:0;width:100%;height:40px;" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"><em>分享到新浪</em></a></li>
                                        <li class="weixin"><a href="#" style="float: none; background:none;padding-left:0;margin:0;width:100%;height:40px;" class="bds_weixin" data-cmd="weixin" title="分享到微信"><em>分享到微信</em></a></li>
                                        <li class="txweibo"><a href="#" style="float: none; background:none;padding-left:0;margin:0;width:100%;height:40px;" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"><em>分享到腾讯</em></a></li>
                                    </ul>
                                    <button>取消</button>
                                    <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"http://a.pgzhe.com/images/logo_t.png","bdStyle":"0","bdSize":"24"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
                                </div>
                            </div>
                            <button class="pro_btn" data="{{$org->id}}">提交项目</button>
                        </dd>
                    </dl>
                </div>
                <div class="wrap">
                    <div class="contain">
                        <div>
                            <p class="result">
                            @if($counts = $org->getProjectCounts($org->id))
                                <em>{{$counts}}</em>个
                            @else
                                <em>0</em>个
                            @endif
                            </p>
                            <p class="c_1">投资数量</p>
                        </div>
                        <div>
                            <p class="result">￥<em>{{$org->invest_money}}万</em></p>
                            <p class="c_1">投资总金额</p>
                        </div>
                    </div>
                    <div class="contain">
                        <div>
                            <p class="result"><em>1000</em>%</p>
                            <p class="c_1">投资回报率</p>
                        </div>
                        <div>
                            <p class="result"><em>19</em>个</p>
                            <p class="c_1">项目走到下一轮</p>
                        </div>
                    </div>
                </div>
            </section>
            <div class="mod">
                <section class="table-list">
                    <div class="case">
                        <h2><em>投资案例</em></h2>
                        <p class="tab"><a href="">更多>></a>投资领域：
                            <span>
                                @if($fields = $org->getFieldsByOrgId($org->id))
                                    @foreach($fields as $field)
                                        <em>{{$field}}</em>
                                    @endforeach
                                @endif

                            </span></p>
                        <div class="list">
                            <ul>
                                <li class="desc">项目简介</li>
                                <li>融资阶段</li>
                                <li>融资时间</li>
                                <li>投资金额</li>
                            </ul>
                            <div>
                                <div class="content">
                                    <ul>
                                        <li>
                                            @if($projects = $org->getProjectByOrgId($org->id))
                                                @foreach($projects as $project)
                                                    <dl>
                                                        <dt>
                                                            <a href="#"><img src="{{route('Api.CreateProjectLogo.Show',['id'=>$project->id])}}"></a>
                                                        </dt>
                                                        <dd class="commpany">
                                                            <p><a href="#"><strong>{{$project->project_name}}</strong></a></p>
                                                            <p>{{$project->project_desc}}</p>
                                                        </dd>
                                                        <dd class="list-foo">
                                                            <div class="list_content">
                                                                <p class="stage"><em class="reveal">融资阶段</em>
                                                                    @if($phases = $org->getPhasesByOrgId($org->id))
                                                                        @foreach($phases as $phase)
                                                                            <em class="floatR">{{$phase}}</em>
                                                                        @endforeach
                                                                    @endif
                                                                </p>
                                                                <p class="type"><em class="reveal">融资时间</em><em
                                                                            class="floatR">
                                                                        @if($org->invest_time != null)
                                                                            {{$org->invest_time}}
                                                                        @else
                                                                            {{date('Y-m',time())}}
                                                                        @endif
                                                                    </em></p>
                                                                <p class="address"><em class="reveal">投资金额</em><em
                                                                            class="floatR">
                                                                        @if($org->money_num!=0)
                                                                            ￥{{$org->money_num}}万
                                                                        @elsew1

                                                                        @endif
                                                                    </em></p>
                                                                <!--<p class="member"><button class="reveal">提交项目</button></p>-->
                                                            </div>
                                                        </dd>
                                                    </dl>
                                                @endforeach
                                            @endif
                                        </li>

                                    </ul>
                                    <p class="more"> <a href="javascript:;">查看全部<em>
                                           (
                                            @if($count = $org->getProjectCounts($org->id))
                                                {{$count}}
                                            @else
                                                0
                                            @endif
                                        )</em></a></p>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 投资团队 -->
                    <div class="team">
                        <h2><em>投资团队</em></h2>
                        @if($investors = $org->getOrgMemberByOrgId($org->id))
                            @foreach($investors as $investor)
                            <div class="contain">
                                <dl>
                                    <dt><a href="#"><img src="{{route('Api.Photo.Show',['id'=>$investor->user_id])}}" /></a></dt>
                                    <dd>
                                        <p><a href="#" class="name">{{$investor->realname}}</a></p>
                                    @if($user = $org->getUserInfoByUserId($investor->user_id))
                                        <p>{{$user->position}}</p>
                                    @endif
                                    </dd>
                                </dl>

                            </div>
                            @endforeach
                        @endif
                    </div>
                </section>
                <section class="details">
                    <h2><em>详细信息</em></h2>
                    <div class="contain">
                        <p>{{$org->invest_name}}</p>
                        <ul>
                            <li>投资案例：<em>
                                    @if($count = $org->getProjectCounts($org->id))
                                        {{$count}}
                                    @else
                                        0
                                    @endif
                                        个</em></li>
                            <li>成立时间：<em>{{date('Y-m',strtotime($org->begin_date))}}</em></li>
                            <li>资金总量：<em>{{$org->invest_money/10000}}亿</em></li>
                            <li>投资阶段：
                                @if($phases = $org->getPhasesByOrgId($org->id))
                                    @foreach($phases as $phase)
                                            <em>{{$phase}}</em>
                                    @endforeach
                                @endif
                            </li>
                            <li>最低投资额：<em>{{$org->min_quota}}万</em></li>
                            <li>最高投资额：<em>{{$org->max_quota}}万</em></li>
                            <li>机构网址：<em></em></li>
                            <li>投资领域：
                                @if($fields = $org->getFieldsByOrgId($org->id))
                                    @foreach($fields as $field)
                                        <em>{{$field}}</em>
                                    @endforeach
                                @endif
                            </li>
                        </ul>
                    </div>
                </section>
            </div>
        </div>
        <div class="p_pos createProject">
            <!--单选1-->
            <div class="new">
                <p>您还没有项目，现在去创建吧！</p><p>
                    <a href="{{route('Home.Project.showCreateProject')}}"><button>创建项目</button></a>
                    <em class="close"></em>
                </p>
            </div>
            <!--单选2-->
            <div class="p_pos_s" style="display: none;">
                <p>申请融资</p>
                <select>
                    @if(Auth::user())
                        @if($userId = Auth::user()->id)
                            @if($projects = \App\Project::whereUserId($userId)->get())
                                @foreach($projects as $project)
                                    <option value="{{$project->id}}">{{$project->project_name}}</option>
                                @endforeach
                            @endif
                        @endif
                    @endif
                </select><br>
                <button>提交项目</button>
                <em class="close"></em>
            </div>
        </div>
        <div class="mirror">123</div>
    </main>
    <script type="text/javascript">
        var getProjectByUserId              = "{{route('Api.Project.getProjectByUserId')}}";
        var CommitProjectToInvestOrg        = "{{route('Api.Project.CommitProjectToInvestOrg')}}";
    </script>
@endsection